package zuo.algo.util;

import java.util.Random;

public class StringUtils {

    private static final String ALL_CHARS = "abcdefghigklmnopqrstuvwsyz";

    public static String getRandomStr(int len) {
        Random random = new Random();
        int max = ALL_CHARS.length();
        char[] chars = new char[len];
        for (int i = 0; i < len; i++) {
            int idx = random.nextInt(max);
            chars[i] = ALL_CHARS.charAt(idx);
        }
        return new String(chars);
    }
}
